package com.eques.database.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.eques.database.DevList
import com.eques.database.ShaowData
import kotlinx.coroutines.flow.Flow

@Dao
interface ShaowDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertShaow(user: ShaowData)

    @Query("SELECT * FROM shaow WHERE user_name=:userName and bid=:devId")
    fun getShaow(userName: String, devId: String): List<ShaowData>

    @Query("SELECT * FROM shaow WHERE user_name=:userName and bid=:devId LIMIT 1")
    fun getShaowEntry(userName: String, devId: String): ShaowData

    @Update
    fun updateShaow(user: ShaowData)
}